package com.linkage.jz.bankruptcy.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.linkage.jz.bankruptcy.R;

/**
 * 注意 该接口的实现只能使用无参构造
 */
public class ZQPreviewItemHeaderImpl implements ZQPreviewItemAdapter {

    private String text;
    private int action;

    public ZQPreviewItemHeaderImpl(String text, int action) {
        this.text = text;
        this.action = action;
    }

    @Override
    public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
        View view = layoutInflater.inflate(R.layout.item_zq_preview_category, viewGroup, false);
        TextView textView = view.findViewById(R.id.label);
        textView.setText(text);
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (action) {
                    case 0:
                        //todo
                        break;
                }
            }
        });
        return view;
    }

    @Override
    public void bindVh(ZQPreviewModelAdapter.PreviewModelVH previewModelVH) {

    }
}
